#ifndef UTILS_H
#define UTILS_H

#include <FnAttribute/FnAttribute.h>
#include <FnScenegraphIterator/FnScenegraphIterator.h>
#include <Render/RenderSettings.h>
#include <RenderOutputUtils/RenderOutputUtils.h>

#include <core/paramset.h>

#include <map>
#include <string>
#include <iostream>

namespace FnKAt = Foundry::Katana;
using namespace std;

#define KATANA_PBRT_QUIET false

// Data Structures
typedef std::map<std::string, int> OutputFrameIds;

typedef struct
{
    std::string hostAddress;
    float frameTime;
    std::string renderOutputFile;
    std::string renderMethodName;
}BasicSettings;


// Utility functions (implemented in utils.cpp)
bool setIntParam(ParamSet &p, const FnKat::GroupAttribute &groupAttr,
                 const std::string &attrName, const std::string &paramName = "",
                 int nItems = 1, float time = 0.0f);

bool setBoolParam(ParamSet &p, const FnKat::GroupAttribute &groupAttr,
                  const std::string &attrName, const std::string &paramName = "",
                  int nItems = 1, float time = 0.0f);

bool setFloatParam(ParamSet &p, const FnKat::GroupAttribute &groupAttr,
                   const std::string &attrName, const std::string &paramName = "",
                   int nItems = 1, float time = 0.0f);

bool setDoubleParam(ParamSet &p, const FnKat::GroupAttribute &groupAttr,
                    const std::string &attrName, const std::string &paramName = "",
                    int nItems = 1, float time = 0.0f);

bool setStringParam(ParamSet &p, const FnKat::GroupAttribute &groupAttr,
                    const std::string &attrName, const std::string &paramName = "",
                    int nItems = 1, float time = 0.0f);

void error(std::string message);

#endif // UTILS_H
